<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	</head>
	<body>
		相册选择图片：<input id="test1" type="file" accept="image/*"/><br><br>
		强制摄像头图片：<input id="test2" type="file" accept="image/*" capture="camera"/><br><br>
				强制前置摄像头图片：<input id="test2" type="file" accept="image/*" capture="user"/><br><br>


		相册选择视频：<input id="test3" type="file"  accept="video/*" onChange="getFile"/><br><br>
		强制摄像头视频：<input id="test4" type="file"  accept="video/*" capture="camcorder"/><br>
		强制前置摄像头视频：<input id="test4" type="file"  accept="video/*" capture="user"/><br>

	</body>
	<script>
		document.getElementById("test1").addEventListener("change",getFile);
		document.getElementById("test2").addEventListener("change",getFile);
		document.getElementById("test3").addEventListener("change",getFile);
		document.getElementById("test4").addEventListener("change",getFile);
	
		function getFile(e){
			alert('获取到文件：'+this.files[0].name);
		}
	</script>
</html>